 
/*
 * @Author: ZhouNan
 * @Date: 2022-04-18 22:34:27
 * @LastEditors: ZhouNan
 * @LastEditTime: 2022-04-18 23:56:14
 * @FilePath: \export_ts\src\panels\replace\replace.ts
 * @Description: 
 */
import { defineComponent, ref , computed} from "vue";
import Cache from '../../core/00_Cache';

export default defineComponent({
    data() {
        let err_tip = ''
        return {
            err_tip
        }
    },
    methods: {
        onClickSure() {
            this.err_tip='';
            // @ts-ignore
            let assetUUID = this.$refs.asset.value;
            // @ts-ignore
            let scriptUUID = this.$refs.scriptAsset.value;
            if (!assetUUID || !assetUUID.length) {
                this.err_tip='资源不能为空';
            }
            else if (!scriptUUID && !scriptUUID.length) {
                this.err_tip='脚本不能为空';
            }
            else {
                Cache.addCacheWithUUID(scriptUUID, assetUUID);
                console.log('[Export-TS] 已重新绑定');
            }
        },
        onClickClear() {
            this.err_tip='';
            // @ts-ignore
            this.$refs.asset.value = ''
            // @ts-ignore
            this.$refs.scriptAsset.value = ''
        }
    }
})